package org.elanfox.intellicommunity.biz.dto.redis;

import lombok.Data;
import org.elanfox.intellicommunity.biz.entity.equipment.CardPO;
import org.elanfox.intellicommunity.data.base.dto.BaseDTO;

/**
 * 有源卡saveDTO
 *
 * @author loutianxi
 * @date 2019-12-09
 */
@Data
public class RedisCardDTO implements BaseDTO {
    private Integer cardId;
    private Long cardNo;
    private Integer type;
    private String version;
    private boolean status = true;
    private boolean enable = true;
    private Integer voltageStatus;
    private boolean deleteStatus;

    public RedisCardDTO() {
    }

    public RedisCardDTO(CardPO obj) {
        this.cardId = obj.getCardId();
        this.cardNo = obj.getCardNo();
        this.type = obj.getType().getCode();
        this.version = obj.getVersion();
        this.status = obj.isStatus();
        this.enable = obj.isEnable();
        this.voltageStatus = obj.getVoltageStatus().getCode();
        this.deleteStatus = obj.isDeleteStatus();
    }
}
